package com.pattern.structure.adapter;

/**
 * @author yangguanzan
 * @date 4/10/22
 * @description
 */
public class ObjectAdapter implements AdapterTarget {
    private Adaptee adaptee;

    public ObjectAdapter(Adaptee adaptee) {
        this.adaptee = adaptee;
    }

    @Override
    public int request() {
        System.out.println("对象适配器：");
        String result = this.adaptee.specificRequest();
        if(null==result||result.isEmpty()){
            return 0;
        }
        return Integer.valueOf(result);
    }
}
